<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<script type="text/javascript">
	$(document).ready(function(){
		$("#tabs").tabs({active : 0});
	});
</script>

<h3>${groupe}</h3>
<div class="container-fluid">
    <div class="row">
        <form:form name="frmGroupe" modelAttribute="groupe" action="groupe.save" method="post" role="form" cssClass="form form-horizontal">
            <form:hidden path="id" />
            
            <div class="form-group">
                <label class="col-sm-1 control-label" for="nom">Libellé</label>
                <div class="col-sm-4">
                    <form:input path="libelle" placeholder="Nom" required="true" class="form-control" value="${groupe.libelle}"/>
                </div>
            </div>
                
            <div class="form-group">
                <label class="col-sm-1 control-label" for="nom">ID Siecle</label>
                <div class="col-sm-4">
                    <form:input path="codeStructure" placeholder="Nom" required="true" class="form-control" value="${groupe.codeStructure}"/>
                </div>
            </div>
                
            <div class="col-sm-offset-8 col-sm-2 form-group">
                <form:button type="submit" class="btn btn-primary btn-md">Enregistrer</form:button>
            </div>
            
        </form:form>
    </div>
    <div class="row">
        <div id="tabs" class="col-sm-10">
            <ul id="tabsMenu" class="nav nav-tabs nav-justified">
              <li><a href="#elevesTab">Elèves</a></li>
              <li><a href="#servicesTab">Services</a></li>
              
              <li><a href="#classesTab">Classes</a></li>
              <li><a href="#mefsTab">MEFS</a></li>
            </ul>
            <div id="elevesTab">
                <jsp:include page="groupe/liste_eleves.jsp" />
            </div>

            <div id="servicesTab">
                <jsp:include page="groupe/services_enseignants.jsp" />
            </div>
            <div id="classesTab">
                <ul>
                    <c:forEach items="${groupe.structuresAppartenance}" var="st">
                        <li>${st}</li>
                    </c:forEach>
                </ul>
            </div>
            <div id="mefsTab">
                <ul>
                    <c:forEach items="${groupe.mefs}" var="mef">
                        <li>${mef}</li>
                    </c:forEach>
                </ul>
            </div>
        </div>
     </div>
</div>